123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288 |
- <template>
- <!-- 页面头部 -->
- <HomePageHead></HomePageHead>
- <!-- 导航栏 -->
- <HomePageNavigation></HomePageNavigation>
- <!-- 列表页广告一 -->
- <HomeTopTen :imgurl="adImg1" v-if="adImg1"></HomeTopTen>
- <!-- 资讯列表 -->
- <div class="newsDetail">
- <div class="inner">
- <div class="innerLeft">
- <section class="book_son_right clearfix" v-if="newsDetail != ''">
- <div class="book_detail_box clearfix">
- <div class="book_detail_img_box">
- <img class="book_detail_img" :src="newsDetail.img_url" alt="" v-if="newsDetail.img_url">
- </div>
- <div class="book_detail_right clearfix">
- <h4 class="book_detail_right_h4">{{ newsDetail.title }}</h4>
- <div class="book_detail_right_title">现售价:</div>
- <div class="book_detail_price_box clearfix">
- <div class="book_detail_price_box_in clearfix">
- <span class="book_detail_price_red">¥</span>
- <span class="book_detail_price_num"
- v-if="newsDetail.price == '' || newsDetail.price != 0">
- {{ newsDetail.price }}
- </span>
- </div>
- <span class="book_detail_price_text">市场价:</span>
- <span class="book_detail_price_delete"
- v-if="newsDetail.market_price == '' || newsDetail.market_price != 0">
- {{ newsDetail.market_price }}
- </span>
- </div>
- <div class="book_detail_right_ul clearfix">
- <div class="book_detail_right_li clearfix">
- <label class="book_detail_right_li_label">页数:</label>
- <span class="book_detail_right_li_text"
- v-if="newsDetail.page == '' || newsDetail.page != 0">
- {{ newsDetail.page }}
- </span>
- </div>
- <div class="book_detail_right_li clearfix">
- <label class="book_detail_right_li_label">开本:</label>
- <span class="book_detail_right_li_text" v-if="newsDetail.format">
- {{ newsDetail.format }}
- </span>
- </div>
- <div class="book_detail_right_li clearfix">
- <label class="book_detail_right_li_label">纸张:</label>
- <span class="book_detail_right_li_text" v-if="newsDetail.paper">
- {{ newsDetail.paper }}
- </span>
- </div>
- <div class="book_detail_right_li clearfix">
- <label class="book_detail_right_li_label">包装:</label>
- <span class="book_detail_right_li_text" v-if="newsDetail.package">
- {{ newsDetail.package }}
- </span>
- </div>
- <div class="book_detail_right_li clearfix">
- <label class="book_detail_right_li_label">出版社:</label>
- <span class="book_detail_right_li_text" v-if="newsDetail.publishing_house">
- {{ newsDetail.publishing_house }}
- </span>
- </div>
- <div class="book_detail_right_li clearfix">
- <label class="book_detail_right_li_label">出版时间:</label>
- <span class="book_detail_right_li_text" v-if="newsDetail.publish_time">
- {{ getTime(newsDetail.publish_time, 'year', 1) }}
- </span>
- </div>
- <div class="book_detail_right_li clearfix">
- <label class="book_detail_right_li_label">ISBN:</label>
- <span class="book_detail_right_li_text" v-if="newsDetail.ISBN">
- {{ newsDetail.ISBN }}
- </span>
- </div>
- <div class="book_detail_right_li clearfix">
- <label class="book_detail_right_li_label">国内统一刊号CN:</label>
- <span class="book_detail_right_li_text" v-if="newsDetail.CN">
- {{ newsDetail.CN }}
- </span>
- </div>
- </div>
- </div>
- </div>
- <div class="book_detail_head_box clearfix">
- <div class="book_detail_head_left">
- <a class="book_detail_head_a book_detail_head_only" href="" title="">内容简介</a>
- </div>
- </div>
- <!-- 内容简介 -->
- <article class="book_detail_article" v-html="newsDetail.detail"></article>
- <!-- 内容简介 -->
- </section>
- <!-- 免责声明: -->
- <!-- v-if="newsDetail.copyfrom != '本网'" -->
- <div class="disclaimer" v-if="newsDetail.source != '本网'">
- <p>原文链接:{{ newsDetail.source_url }}</p>
- <p>[免责声明]本文来源于网络转载,仅供学习交流使用,不构成商业目的。 版权归原作者所有,如涉及作品内容,版权和其他问题,请在30日与本网联系,我们将第一时间处理。</p>
- </div>
- </div>
- <div class="innerRight">
- <div class="rightMenuTitle">
- <NuxtLink :to="`/${parent_pinyin}/index.html`"> {{ parent_name }}</NuxtLink>
- </div>
- <ul>
- <li v-for="(item, index) in bottomMenu" :key="index">
- <NuxtLink :to="`/${item.pinyin}/list-1.html`" :title="item.name"
- v-if="item.category_id == pageId" class="active">
- {{ item.alias }}
- </NuxtLink>
- <NuxtLink :to="`/${item.pinyin}/list-1.html`" :title="item.name"
- v-else-if="item.category_id != pageId">
- {{ item.alias }}
- </NuxtLink>
- </li>
- </ul>
- </div>
- <div style="clear: both;"></div>
- </div>
- </div>
- <!-- 广告二 -->
- <HomeTopTen :imgurl="adImg2" v-if="adImg2"></HomeTopTen>
- <!-- 页面底部 -->
- <HomeFoot1></HomeFoot1>
- </template>
- <script setup>
- //1.页面依赖 start ---------------------------------------->
- import { ref, onMounted } from 'vue';
- //获得跳转过来的id
- const route = useRoute();
- //获得当前的完整路径
- const fullPath = route.path;
- //拆分,取出来中间这一段,然后提取数字部分
- const segments = fullPath.split('/');
- const targetSegment = segments[2];
- const targetSegment1 = segments[1];
- //const numberPart = targetSegment.match(/\d+$/)?.[0];
- let articleId;
- let pageId;
- let routeId
- let activeId = parseInt(route.params.id);
- console.log('activeId', activeId);
- //通过导航路径反向查询导航id
- const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
- method: 'GET',
- query: {
- 'pinyin': targetSegment,
- },
- });
- if (getRouteId.code == 200) {
- articleId = getRouteId.data.id;
- pageId = getRouteId.data.category_id;
- } else {
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- console.log("错误位置:通过url路径查询导航池id")
- console.log("后端错误反馈:", getRouteId.message)
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- }
- //通过导航路径反向查询导航id
- const getRouteId1 = await requestDataPromise('/web/getWebsiteRoute', {
- method: 'GET',
- query: {
- 'pinyin': targetSegment1,
- },
- });
- if (getRouteId1.code == 200) {
- routeId = getRouteId1.data.category_id;
- } else {
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- console.log("错误位置:通过url路径查询导航池id")
- console.log("后端错误反馈:", getRouteId1.message)
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- }
- //面包屑导航
- const parent_name = ref("");
- const parent_id = ref("");
- const parent_pinyin = ref("");
- let getParentNav = async () => {
- const listData = await requestDataPromise('/web/getOneWebsiteCategory', {
- method: 'GET',
- query: {
- 'catid': routeId,
- },
- });
- if (listData.code == 200) {
- parent_name.value = listData.data.alias;
- parent_id.value = listData.data.parent_id;
- parent_pinyin.value = listData.data.aLIas_pinyin;
- } else {
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- console.log("错误位置:获取面包屑导航")
- console.log("后端错误反馈:", listData.message)
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- }
- }
- //获得父级栏目详情
- getParentNav();
- //1.页面依赖 end ---------------------------------------->
- //2.页面数据 start ---------------------------------------->
- //广告列表
- let adImg1 = ref([]);
- let adImg2 = ref([]);
- onMounted(async () => {
- //从客户端获取行政职能部门 加快打开速度
- const { $webUrl, $CwebUrl } = useNuxtApp();
- //广告1
- let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_detail_0001`
- const responseAd1 = await fetch(url, {
- headers: {
- 'Content-Type': 'application/json',
- 'Userurl': $CwebUrl,
- 'Origin': $CwebUrl
- }
- });
- const resultAd1 = await responseAd1.json();
- adImg1.value = resultAd1.data[0];
- //广告2
- let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_detail_0002`
- const responseAd2 = await fetch(url2, {
- headers: {
- 'Content-Type': 'application/json',
- 'Userurl': $CwebUrl,
- 'Origin': $CwebUrl
- }
- });
- const resultAd2 = await responseAd2.json();
- adImg2.value = resultAd2.data[0];
- })
- //获取页面信息
- const newsDetail = ref({})
- const bottomMenu = ref([]);
- async function getPageMenu() {
- const mkdata = await requestDataPromise('/web/getWebsiteBookInfo', {
- method: 'GET',
- query: {
- 'id': activeId,
- },
- });
- bottomMenu.value = mkdata.data.category;
- newsDetail.value = mkdata.data.books;
- }
- getPageMenu();
- //2.页面数据 end ---------------------------------------->
- //4.设置seo信息 start---------------------------------------->
- //4.1 设置seo信息
- const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
- method: 'GET',
- query: {},
- });
- let seoTitle = setData.data.website_head.title;
- let seoDescription = setData.data.website_head.description;
- let seoKeywords = setData.data.website_head.keywords;
- let seoSuffix = setData.data.website_head.suffix;
- let seoName = setData.data.website_head.website_name;
- useSeoMeta({
- title: seoTitle + "_" + seoSuffix,
- meta: [
- { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
- { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
- ]
- });
- //4.设置seo信息 end---------------------------------------->
- </script>
- <style lang="less" scoped>
- @import '@/assets/css/shukanDetail.less';
- </style>
|